package com.lagou.service.impl;

import com.lagou.service.HelloService;
import org.apache.dubbo.config.annotation.Service;

import java.util.Random;

@Service
public class HelloServiceImpl   implements HelloService {
    @Override
    public String sayHello(String name,int timeToWait) {
        return "hello:"+name;
    }

    @Override
    public String sayHai(String name) {
        Random random = new Random();
        int num = random.nextInt(101);
        try {
            Thread.sleep(num);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "I am sayNiHao ,I have sleeped " + num + " ms";
    }

    @Override
    public String sayNiHao(String name) {
        Random random = new Random();
        int num = random.nextInt(101);
        try {
            Thread.sleep(num);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "I am sayNiHao ,I have sleeped " + num + " ms";
    }

    @Override
    public String sayNiHaoA(String name) {
        Random random = new Random();
        int num = random.nextInt(101);
        try {
            Thread.sleep(num);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "I am sayNiHaoA ,I have sleeped " + num + " ms";
    }
}
